package com.example.mybatisplus.mapper;

import com.example.mybatisplus.model.domain.Review;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lxp
 * @since 2025-03-10
 */
@Mapper
public interface ReviewMapper extends BaseMapper<Review> {
    @Select("SELECT prediction, COUNT(*) as count FROM review GROUP BY prediction")
    List<Map<String, Object>> getSentimentDistribution();
}
